/*
  Tên:Trần Hoàng Lâm
  MSSV:11379951
  Lớp:DHTH7DLT
  Ngày hoàn thành:24/08/2012
  */
#ifndef DATEFORMATDELEGATE_H
#define DATEFORMATDELEGATE_H
#include "QStyledItemDelegate"

class DateFormatDelegate : public QStyledItemDelegate
{
public:
 DateFormatDelegate (QString dateFormat, QObject *parent = 0) :
  QStyledItemDelegate(parent),
  m_dateFormat(dateFormat)
 {
 }

 virtual QString displayText(const QVariant & value, const QLocale & locale ) const
 {
  Q_UNUSED(locale);
  return value.toDate().toString(m_dateFormat);
 }

private:
 QString m_dateFormat;
};
#endif // DATEFORMATDELEGATE_H
